package com.welovecoding.towerdefense;

import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;

public class Enemy extends AnimatedSprite {
	
	private int life = 3;
	private int speed = 200; // Kecepatan serang ==> 1 detik  = 200
	private boolean isDie = false;
	
	public Enemy(float pX, float pY, TiledTextureRegion pTiledTextureRegion){
		super(pX, pY, pTiledTextureRegion);	
	}
	
	public void getHit(){
		this.life -= 1;
	}
	
	public int getLife(){
		return this.life;
	}
	
	public void changeSpeed(int newSpeed){
		this.speed = newSpeed;
	}
	
	public int getSpeed(){
		return this.speed;
	}
	
	public void die(){
		this.isDie = true;
	}
	
	public boolean LifeOrDie(){
		return this.isDie;
	}
}
